package com.attendance.chdingtask.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Data
@Table(name="md_details")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModel(description = "员工表")
@EntityListeners(AuditingEntityListener.class)
public class MdDetails implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @ApiModelProperty(value = "主键")
    private  Long id;

    private  String MdId;
    /**
     * 钉钉人员id
     */
    @ApiModelProperty(value = "人员id")
    private String userId;
    /**
     * 魔点设备SN码
     */
    @ApiModelProperty(value = "魔点设备SN码")
    private  String deviceSn;
    /**
     * 打卡时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "打卡时间")
    private Date recognizeTime;

    /**
     * 用户名称
     */
    @ApiModelProperty(value = "用户名称")
    private String userName;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    private String mobile;

    /**
     * 用户unionid
     */
    @ApiModelProperty(value = "用户unionid")
    private String unionid;


    /**
     * 钉钉部门id 对应多个部门
     */
    @ApiModelProperty(value = "钉钉部门id")
    private String deptId;

    /**
     * 钉钉部门名称 对应多个部门
     */
    @ApiModelProperty(value = "钉钉部门名称")
    private String deptName;


    /**
     * 魔点设备id
     */
    @ApiModelProperty(value = "魔点设备id")
    private  Long deviceId;


    /**
     * 魔点设备名称
     */
    @ApiModelProperty(value = "魔点设备名称")
    private  String deviceName;

    /**
     * 门禁简称
     */
    @ApiModelProperty(value = "门禁简称")
    private  String shortName;


    /**
     * 进出入标识符：J-表示进；C-表示出
     */
    @ApiModelProperty(value = "进出入标识符：J-表示进；C-表示出")
    private String flag;

    /**
     *  区域id；
     */
    @ApiModelProperty(value = "地点id")
    private Long areaId;

    /**
     * 区域名称：  生产区-0；生活区-1；维护基地-2；
     */
    @ApiModelProperty(value = "区域名称")
//    @Excel(name="")
    private String areaName;

    /**
     * 管理单位
     */
    @ApiModelProperty(value = "管理单位")
//    @Excel(name="")
    private String areaType;

    /**
     * 年份
     */
    @ApiModelProperty(value = "年份")
    private String year;



    private String corpId;


    /**
     * 月份
     */
    @ApiModelProperty(value = "月份")
    private String month;


    /**
     * 日期
     */
    @ApiModelProperty(value = "日期")
    private String MdDate;

    /**
     * 日期
     */
    @ApiModelProperty(value = "时间")
    private String MdTime;

    /**
     * 删除标志
     */
    private Integer dr = Integer.valueOf(0);


    @CreatedDate
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @LastModifiedDate
    @Column(name = "modify_time")
    @ApiModelProperty(value = "修改时间")
    private Date modifyTime;

    @Transient
    @ApiModelProperty(value="人数")
    private Integer recordCount;

}
